<template>
  <el-form-item :label="label" :prop="prop">
    <el-input
        v-model="newv"
        :placeholder="placeholder"
        :show-password="showPassword"
        :disabled="disabled"
        :maxlength="maxlength"
        :type="type"
    />
  </el-form-item>
</template>
<script setup>
import {computed} from 'vue';

const props = defineProps({
  modelValue: [String, Number],
  label: {
    type: String,
    default: "",
  },
  prop: {
    type: String,
    default: "",
  },
  placeholder: {
    type: String,
    default: "请输入",
  },
  showPassword: [Boolean],
  disabled: {
    type: Boolean,
    default: false,
  },
  maxlength: {
    type: Number,
    default: null,
  },
  type:{
    type: String,
    default: "text"
  }
});
const emit = defineEmits(["update:modelValue"]);

const newv = computed({
  get() {
    return props.modelValue;
  },
  set(value) {
    emit("update:modelValue", value);
  },
});
</script>
